package com.glsc.ngateway.flowable.service.feignservice;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.glsc.ngateway.common.api.platform.feign.IFeignPlatformService;
import com.glsc.ngateway.common.api.platform.resp.PlatformResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PlatformFeignService {

    @Autowired
    IFeignPlatformService iFeignPlatformService;

    public String findByUserName(String userName) {
        if(StrUtil.isEmpty(userName)){
            return "";
        }
        PlatformResponse<String> platformResponse = iFeignPlatformService.findByUserName(userName);
        if (ObjectUtil.isNotNull(platformResponse) && platformResponse.getStatus() == 0) {
            return platformResponse.getData().toString();
        }
        return "";
    }

}
